//-----------------------------------------------------------------------
// <copyright file="tblExchangeRateService.cs" company="Cyvee">
//     Copyright ? Cyvee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using Scb.Framework;
using Robot.Entities;
using Robot.Data;
    
namespace Robot.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class tblExchangeRateService
    {
        #region tblExchangeRate

        public static void CreatetblExchangeRate(tblExchangeRate tblExchangeRate)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                tblExchangeRateDAO.CreatetblExchangeRate(tblExchangeRate);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreatetblExchangeRateException, ex);
            }
        }        

        public static void UpdatetblExchangeRate(tblExchangeRate tblExchangeRate)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                tblExchangeRateDAO.UpdatetblExchangeRate(tblExchangeRate);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdatetblExchangeRateException, ex);
            }
        }        

        public static void DeletetblExchangeRate(Guid id)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                tblExchangeRateDAO.DeletetblExchangeRate(id);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeletetblExchangeRateException, ex);
            }
        }
        
        public static tblExchangeRate GettblExchangeRate(Guid id)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                return tblExchangeRateDAO.GettblExchangeRate(id);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblExchangeRateException, ex);
            }
        }                

        public static tblExchangeRateCollection GettblExchangeRateList(tblExchangeRateColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                return tblExchangeRateDAO.GettblExchangeRateList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblExchangeRateListException, ex);
            }
        }        

        public static tblExchangeRateCollection GettblExchangeRateList(tblExchangeRateColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                tblExchangeRateDAO tblExchangeRateDAO = new tblExchangeRateDAO();
                return tblExchangeRateDAO.GettblExchangeRateList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblExchangeRateListException, ex);
            }
        }        

        #endregion
    }
}